import 'package:http/http.dart' as http;
import 'dart:convert';

Future getCode() {
  final url =
      "http://192.168.0.85:8001/service/api/permission/free/security/rsa";
  final securityKey = "6ea1cf81-3b16-1c1f-f105-797def773484";
  // 构建带查询参数的 URL
  final uri = Uri.parse(
    url,
  ).replace(queryParameters: {'securityKey': securityKey});
  return http.get(uri).then((res) {
    return jsonDecode(res.body);
  });
}

void main() {
  getCode()
      .then((resp) {
        if (resp['code'] == 0) {
          print(resp['data']);
        }
      })
      .catchError((error) => print(error));
}
